home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / c / blckade.exe / BLOCKADE.DOC < prev    next >
Text File  |  1992-10-23  |  27KB  |  991 lines

  1.     
  2.     
  3.     
  4.     
  5.     
  6.     
  7.     
  8.     
  9.     
  10.     
  11.     
  12.     
  13.     
  14.                               BLOCKADE (TM)
  15.                     A self checker library for C programs
  16.     
  17.     
  18.     
  19.     
  20.     
  21.     
  22.                     Copyright (C) 1991,92 Indusoft Corp.
  23.     
  24.     
  25.     
  26.     
  27.     
  28.     
  29.     
  30.     
  31.                            Indusoft Corp.
  32.                            PO. Box 26747
  33.                        Greenville, SC 29616-1747
  34.     
  35.     
  36.     
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.              Blockade, (C) Copyright 1991-92 Indusoft Corp.  page -1-
  59.  
  60.     
  61.     
  62.     
  63.     
  64.     
  65.          OVERVIEW
  66.     
  67.          Blockade is a function library for C programmers which allows
  68.          your C programs to protect themselves against unauthorized
  69.          changes. Virus protection IMMEDIATELY comes to mind as its main
  70.          use, but there are more.
  71.     
  72.          I wrote BLOCKADE so that programs I wrote could check
  73.          themselves. Have you had those times too?  Those unexplainable
  74.          times when a program runs but has some odd behavior that makes
  75.          you suspect corruption, virus related or not.
  76.     
  77.          This happened to me when I was checking out a disk caching
  78.          utility. Files I had compiled and linked often quit running
  79.          after copying them to another disk or subdirectory. The
  80.          combination of controller, BIOS, and cache software was
  81.          causing just a few bytes of a file to be altered anytime I
  82.          copied it (and of course without warning or notice).
  83.     
  84.          After several hours of searching, I found the problem and
  85.          looked for a way to make my programs self checking. The result
  86.          was BLOCKADE.
  87.     
  88.          BLOCKADE checks every byte of your EXE or COM to insure that
  89.          changes are detected. Its algorithm is designed to be effective
  90.          but fast enough allow use in your programs.
  91.     
  92.          I also use BLOCKADE in my products to protect against
  93.          unauthorized patches to my programs and to protect my
  94.          customers from running versions of the program damaged
  95.          unintentionally.
  96.     
  97.          Blockade is easy to use.  1 major function analyses your EXE
  98.          file and returns a status code indicating whether your file has
  99.          been altered.
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.              Blockade, (C) Copyright 1991-92 Indusoft Corp.  page -2-
  118.  
  119.     
  120.     
  121.     
  122.     
  123.          NEAT FEATURES
  124.     
  125.          * Fast operation. A 40k EXE file can check itself in less
  126.            than 3 seconds on a 12 MHZ AT.
  127.     
  128.          * Ease of use.  A few #includes and only a handful
  129.            of additions are needed to use BLOCKADE. No changes to
  130.            your program's basic structure are necessary.
  131.     
  132.          * Ability to add user data to a program "skeleton".
  133.            useful for adding customer names and serial numbers.
  134.          
  135.          * Expandable.  BLOCKADE can be modified to extend the
  136.            number and type checking methods you use.
  137.            The source code to BLOCKADE is available, allowing you to
  138.            create new checking methods unique to your application.
  139.     
  140.          
  141.          THEORY OF OPERATION
  142.     
  143.     
  144.          Blockade works via 2 pieces of code you add to your program.
  145.     
  146.          (1)  A special data structure "SIGNATUR.H", which is #include'd
  147.               in your program.  The structure reserves room for the
  148.               information BLOCKADE will need to analyze your program.
  149.     
  150.          (2)  The function blockade(), which checks your program for
  151.               alteration.
  152.     
  153.          After linking, a special program (BRAND.EXE) is run to find the
  154.          special string included by "SIGNATUR.H" in the data area of
  155.          your EXE file, calculate the checking information and overwrite
  156.          that area with the data blockade() needs to detect changes to
  157.          your file.  Once branded, your program can check itself for
  158.          changes each time it is run.
  159.     
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.              Blockade, (C) Copyright 1991-92 Indusoft Corp.  page -3-
  177.  
  178.     
  179.     
  180.     
  181.     
  182.          I HAVE TO RUN BRAND.EXE  EACH TIME I RELINK MY APPLICATION ?
  183.     
  184.     
  185.          That's the problem I had with other products similar to
  186.          BLOCKADE. The biggest headache was time - it seemed to take
  187.          forever for them to calculate and update my program.
  188.     
  189.          To combat that, ALOT of time went into the all the utilities to
  190.          make things FAST.  For example, on an 8 MHz AT, the Brand
  191.          utility will analyze and brand a 40 K .EXE file in less than 4
  192.          seconds.
  193.     
  194.          The same thing is true for your developed applications. Nobody
  195.          wants to wait 30-40 seconds every time they start your program
  196.          while it self checks.  The check algorithm in BLOCKADE is quick.
  197.          Running from a hard disk, I doubt anyone will notice the delay.
  198.     
  199.          I leave the BLOCKADE code linked in during development - to
  200.          take into account the effect it has on speed and memory use -
  201.          but have the program ignore any error codes until my final
  202.          production link.
  203.     
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.              Blockade, (C) Copyright 1991-92 Indusoft Corp.  page -4-
  236.  
  237.     
  238.     
  239.     
  240.          CONTENTS
  241.     
  242.     
  243.          This self extracting file should contain at least the following files:
  244.     
  245.     
  246.          blkade1.c       - the error message function used by BLOCKADE.
  247.          blkdmoms.lib    - Blockade demo library Microsoft 5.1 (Small model)
  248.          blkdmoml.lib    - Blockade demo library Microsoft 5.1 (Large model)
  249.          blkdmots.lib    - Blockade demo library Turbo C 2.01 (Small model)
  250.          blkdmotl.lib    - Blockade demo library Turbo C 2.01 (Large model)
  251.          blkdmobs.lib    - Blockade demo library Borland C++ 2.0 (Small model)
  252.          blkdmobl.lib    - Blockade demo library Borland C++ 2.0 (Large model)
  253.          brand.exe       - calculates your program's checkcode data
  254.                            and "brands" it into your .EXE file.
  255.          demo.c          - Demonstrates use of the Blockade function library.
  256.          demo.exe        - Demo program demonstrating BLOCKADE's use.
  257.          demo.mak        - Microsoft C make file for DEMO.EXE.
  258.          rundemo.bat     - Demonstrates use of the Blockade system.
  259.          mksig.exe       - Generates a SIGNATUR.H file.
  260.          signatur.h      - include file to be embedded in your program.
  261.          blkproto.h      - function prototypes for blockade functions.
  262.          userdata.dat    - a sample user data file used with DEMO.EXE.
  263.          read.me         - any last minute info.
  264.     
  265.          The file BLKDEMO.PAK is an ASCII file listing the exact files
  266.          in this distribution.
  267.     
  268.     
  269.          
  270.          COMPILER'S SUPPORTED
  271.          
  272.          The test drive of BLOCKADE version comes with libraries for
  273.          Turbo C 2.0, Borland C++ 2.0 and Microsoft C 5.x.  I don't know
  274.          if these are usable with Microsoft 6.0.  According to Borland,
  275.          the C++ libraries are NOT reliably usable with Turbo C 2.0.
  276.          However, Turbo C++ and Borland C++ libraries do seem to be
  277.          compatible.
  278.     
  279.          For now, folks with other C compilers must license the source
  280.          code and compile it themselves.  BLOCKADE and all it's support
  281.          programs are written in (almost) ANSI C so things should
  282.          compile up just fine.
  283.          
  284.          The libraries were compiled with the following options.
  285.     
  286.          For TC   :   tc  -O -G -c  -ml(or s)
  287.     
  288.          For BCC  :   bcc -O -G -c  -ml(or s)
  289.     
  290.          For MSC  :   CL /W3 /Ox /Zi  /c /AL(or S)
  291.  
  292.  
  293.  
  294.              Blockade, (C) Copyright 1991-92 Indusoft Corp.  page -5-
  295.  
  296.     
  297.     
  298.     
  299.          Below is an short program illustrating the BLOCKADE system.
  300.          (This is in fact a section of the DEMO program included in your
  301.          BLOCKADE package)
  302.     
  303.     
  304.     
  305.     
  306.